package com.shujia.wyh.dao;


import com.shujia.wyh.entity.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EmpDao {
    @Select("select * from emp where empno like '9%'")
    List<Emp> findAll();

    @Insert("insert into emp (empno,ename,job,mgr,hiredate,sal,comm,deptno) values (#{empno},#{ename},#{job},#{mgr},#{hiredate},#{sal},#{comm},#{deptno})")
    int add(Emp emp);

    @Delete("delete from emp where empno=#{empno}")
    int delete(String empno);

    @Select("select * from emp where empno=#{empno}")
    Emp findByEmpno(String empno);

    @Update("update emp set empno=#{empno},ename=#{ename},job=#{job},mgr=#{mgr},hiredate=#{hiredate},sal=#{sal},comm=#{comm},deptno=#{deptno} where empno=#{empno}")
    int updateEmp(Emp emp);
}
